package action.article;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import service.ArticleManager;
import service.impl.ArticleManagerImpl;

public class ListAllArticleTypeAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ArticleManager am = new ArticleManagerImpl();
		request.getSession().setAttribute("PRE_URL",request.getHeader("Referer"));
		request.setAttribute("articleTypeList", am.getAllArticleType());
		request.setAttribute("msg", am.getMsg());
		
		return mapping.findForward("listArticleType");
	}

}
